package demo_6p;

public class Test {

    public static void drawMap(Shape shape){
        shape.draw();
    }

    public static void main1(String[] args) {
        Cycle c = new Cycle();
        Triangle t = new Triangle();
        drawMap(c);
        drawMap(t);
    }

    public static void main(String[] args) {
//        Cycle c = new Cycle();
//        Triangle t = new Triangle();
//        Shape[] shapes = {c, t};
//        for (Shape shape : shapes) {
//            shape.draw();
//        }

        Cycle c = new Cycle();
        Triangle t = new Triangle();
        String[] strings = {"c", "t"};
        for(String s : strings){
            if(s.equals("c")){
                c.draw();
            }else{
                t.draw();
            }
        }

    }
}
